﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace SimpleWpfTemplate.ViewModels
{
    public class MainViewModel:BindableBase
	{
		/// <summary>
		/// 
		/// </summary>
		public DelegateCommand<string> OpenCommand { get;private set; }

		public IRegionManager RegionManager { get;private set; }

		public MainViewModel(IRegionManager regionManager)
		{
			OpenCommand = new DelegateCommand<string>(Open);
			RegionManager = regionManager;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="name"></param>
		public void Open(string name)
		{
			RegionManager.Regions["ContentRegion"].RequestNavigate(name);
		}
	}
}
